package com.quanyan.user.request;


import org.apache.commons.lang3.StringUtils;

import java.io.Serializable;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * Created by Administrator on 2016/6/12.
 */
public class ReqUserParam implements Serializable{

    private static final long serialVersionUID = 489266121487193771L;

    private Integer uid;

    private String phone;

    private String nickName;

    private String name;

    private String password;

    private String icon;//头像

    private Date born;

    private Integer gender;

    private Integer provinceId;//省份

    private Integer areaId;//城市

    private String sing;//签名



    public Integer getUid() {
        return uid;
    }

    public void setUid(Integer uid) {
        this.uid = uid;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public Integer getGender() {
        return gender;
    }

    public void setGender(Integer gender) {
        this.gender = gender;
    }


    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public Date getBorn() {
        return born;
    }

    public void setBorn(Date born) {
        this.born = born;
    }

    public Integer getProvinceId() {
        return provinceId;
    }

    public void setProvinceId(Integer provinceId) {
        this.provinceId = provinceId;
    }

    public Integer getAreaId() {
        return areaId;
    }

    public void setAreaId(Integer areaId) {
        this.areaId = areaId;
    }

    public String getSing() {
        return sing;
    }

    public void setSing(String sing) {
        this.sing = sing;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return "ReqUserParam{" +
                "uid=" + uid +
                ", phone='" + phone + '\'' +
                ", nickName='" + nickName + '\'' +
                ", name='" + name + '\'' +
                ", password='" + password + '\'' +
                ", icon='" + icon + '\'' +
                ", born=" + born +
                ", gender=" + gender +
                ", provinceId=" + provinceId +
                ", areaId=" + areaId +
                ", sing='" + sing + '\'' +
                '}';
    }

    public Map<String,Object> toMap(){
        Map<String,Object> map = new HashMap<String, Object>();
        if(uid != null)
            map.put("uid",uid);

        if (StringUtils.isBlank(phone))
            map.put("phone",phone);
        return map;
    }
}
